<template>
  <div class="housingMsg">
      <header>
          <img @click="back" src="http://bpic.588ku.com/original_pic/19/04/18/9ac65d10f0e5ede674d0ab0abcad5b96.jpg" alt="">
          <h3>张先生</h3>
     </header>
     <div class="content">
         <div class="topBox" >
            <dl class="dl" >
                <dt>
                    <img :src="msgList[1].imgurl" alt="">
                </dt>
                <dd class="dd">
                    <h3>{{msgList[1].housetitle}}</h3>
                    <span>{{msgList[1].baseinfo}}</span>
                    <span class="span2">{{msgList[1].price}}/月</span>
                    <span>{{msgList[1].floorType}}</span>
                </dd>
            </dl>
        </div>
     </div>
  </div>
</template>

<script>
import {getList} from '../../services/index'
export default {
    data() {
      return {
        msgList:[]
      }
      
    },
    async onShow(){
        //页面列表
        let result=await getList(
            'broom=&buildarea=&communityid=&decoratetype=&floortype=&heading=&keywords=&location=&nearby=&othertype=&price=&renttype=&districtids=&sqids=&lineid=&stationid=&tags=&psort=&lift=&heatingType=&buildType=&page=1&pcount=15&source=3'
        )
        // let ite=0
        // let arrIndex=2
        if(result.status==200){
            this.msgList=result.data.list
        }
        console.log(this.msgList[1],'msgList');

    },
    methods: {
        back(){
            wx.navigateTo({    //跳转到tabBar页面，并关闭其他所有tabBar页面
                url:"/pages/housing/index"
            })
        },
    }
}
</script>

<style lang="scss" scoped>
    .housingMsg{
    width: 100%;
    height: 100%;
    background-color: rgb(35,145,249);
    display: flex;
    flex-direction: column;
  }
  header{
        width: 100%;
        height: 80rpx;
        line-height: 60rpx;
        margin-top: 50rpx;
        margin-bottom: 10px;
        display: flex;
        padding: 0 20px;
        box-sizing: border-box;
        align-items: center;
        color:#fff ;
        h3{
            margin: 0px 100px;
        }
        img{
            width: 20px;
            height: 20px;
            padding: 0px 5px;
        }
  }
  .content{
        flex: 1;
        background-color: rgb(242,242,242);
        display: flex;
        flex-direction: column;
  }
  .topBox{
      width: 100%;
      display: flex;
      flex-direction: column;
      background-color: #fff;
  }
  .dl{
      width: 100%;
      display: flex;
      height: 150px;
      img{
          margin: 5px;
          width: 150px;
          height: 120px;
      }
      dd{
          margin: 10px 0px;
          display: flex;
          flex-direction: column;
          span{
              margin: 5px 0px;
          }
          .span2{
              color: red;
          }
      }
  }
</style>